<template>
  <div class="list">
    <div class="list-item" v-for="(item,index) in list" :key="index" @click="goDetail(index)">
      列表{{ index }}
    </div>
  </div>
</template>
<script>
import useKeepAlivePosition from '@/router/keepAlive.js'
import store from '@/store/index.js'
export default{
  ...useKeepAlivePosition,
  data(){
    return {
      list : new Array(100).fill(1)
    }
  },
  methods : {
    goDetail(index){
      this.$router.push(
        {
          name : 'detail',
          query : {
            a : index
          }
        }
      )
    }
  },
  mounted(){
    console.log(`list mounted`);
  }
}
</script>
<style type="text/css" scoped lang="scss">
.list{
  &-item{
    height:300px;
    border:1px solid #000;
  }
}
</style>
